import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class App {
    public static void main(String[] args) throws Exception {
        System.out.println("Hello, World!");
        Scanner scan=new Scanner(System.in);
        Collection<Integer> list=new ArrayList<Integer>();
        String str="";
        int number=0;
        if(scan.hasNextLine()) str=scan.nextLine()+" ";
        for(char c:str.toCharArray()){  
            if(c!=' ') number=number*10+c-'0';
            else{
                list.add(number);
                number=0;
            }
        }
        for(Integer i:list){
            System.out.print(i+" ");
        }
        Collections.reverse((List<?>) list);
        System.out.println("");
        for(Integer i:list){
            System.out.print(i+" ");
        }
        System.out.println("");
        Collections.sort(list,new Comparator<Integer>(){
            @Override
            public int compare(Integer o1, Integer o2) {
                return 1;
            }
        });
        for(Integer i:list){
            System.out.print(i+" ");
        }
    }
}
